package com.example.ibsp_demo.pojo.entity.user;

import java.time.LocalDateTime;


public class User {
    private Integer uid;            // 用户ID
    private String username;        // 用户名
    private String email;           // 邮箱
    private String phone;           // 手机号
    private String passwordHash;    // 密码哈希
    private Integer status;         // 状态 (1-正常,2-封禁,3-注销)
    private LocalDateTime registerTime;      // 注册时间:datetime类型
    private LocalDateTime lastLoginTime;     // 最后登录时间:datetime类型

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPasswordHash() {
        return passwordHash;
    }

    public void setPasswordHash(String passwordHash) {
        this.passwordHash = passwordHash;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public LocalDateTime getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(LocalDateTime registerTime) {
        this.registerTime = registerTime;
    }

    public LocalDateTime getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(LocalDateTime lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", passwordHash='" + passwordHash + '\'' +
                ", status=" + status +
                ", registerTime=" + registerTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    public User() {
    }

    public User(Integer uid, String username, String email, String phone, String passwordHash, Integer status, LocalDateTime registerTime, LocalDateTime lastLoginTime) {
        this.uid = uid;
        this.username = username;
        this.email = email;
        this.phone = phone;
        this.passwordHash = passwordHash;
        this.status = status;
        this.registerTime = registerTime;
        this.lastLoginTime = lastLoginTime;
    }
}
